﻿using System;


namespace DailyFx.UI
{

	public interface IUIStatus
	{
		///<summary>
		///		Gets or sets whether or not this object is enabled .
		///</summary>
		bool IsEnabled { get; }

		/// <summary>
		///		Sets to enable this object .
		/// </summary>
		void SetEnabled ();

		/// <summary>
		///		Sets to disable this object .
		/// </summary>
		void SetDisabled( bool close );

		/// <summary>
		///		Raised after enabling request occurs.
		/// </summary>
		event EventHandler<UIEnabledEventArgs> Enabled;

		/// <summary>
		///		Raised before perform disabling .
		/// </summary>
		event EventHandler<UIDisabledEventArgs> AttemptingDisabled;

		/// <summary>
		///		Raised after this is disabled.
		/// </summary>
		event EventHandler<UIDisabledEventArgs> Disabled ;
	}


	public class UIEnabledEventArgs : EventArgs 
	{
		/// <summary>
		///		Indicates whether the sender was initialized in addition to being enabled.
		/// </summary>
		public bool WasLoaded;

	}

	public class UIEnabledNotifyEventArgs : EventArgs
	{
		/// <summary>
		///		Gets the element whose enabling was processed.
		/// </summary>
		public object UIElement;

		/// <summary>
		///		Gets or sets a value indicating whether the enabling request was a success.
		/// </summary>
		public bool IsSucceed;
	}


	public class UIDisabledEventArgs : EventArgs
	{
		/// <summary>
		///		Indicates whether the sender was closed in addition to being deactivated.
		/// </summary>
		public bool WasClosed;

	}

}
